import { useState } from "react"

const ToDoList = (props) => {
    console.log(props);

    const [use, setUse] = useState(props)
    return (
        <div className="list">
            <ul>
                {
                    props.list.list.map((item, index) => {
                        // console.log(item)
                        return (
                            <li key={index}>
                                <span>{item.title}</span>
                                <span>{item.date}</span>
                                <span
                                    className={[item.priority === '1' ? 'classA' : '' || item.priority === '2' ? 'classB' : '' ||
                                        item.priority === '3' ? 'classC' : '' || item.priority === '4' ? 'classD' : '']}
                                >
                                    {item.priority}
                                </span>
                            </li>
                        )
                    })
                }

            </ul>

        </div>
    )
}
export default ToDoList